// linphone server error code header file

#ifndef _LINPHONE_CODE_H_
#define _LINPHONE_CODE_H_

typedef enum LINPHONE_CODE {
    // sip status code (1xx, 2xx, 3xx, 4xx, 5xx, 6xx) 

    // caller is trying to call callee
    LINPHONE_CODE_SIP_TRYING = 100,
    // callee is ringing
    LINPHONE_CODE_SIP_RINGING = 180,
    // callee is busy, we will forward the call to another callee
    LINPHONE_CODE_SIP_CALL_FORWARDED = 181,
    // callee is busy, we will queue the call
    LINPHONE_CODE_SIP_QUEUED = 182,
    // inband progress
    LINPHONE_CODE_SIP_PROGRESS = 183,
    // callee is ok to receive the call
    LINPHONE_CODE_SIP_OK = 200,
    // callee is accepted the call
    LINPHONE_CODE_SIP_ACCEPTED = 202,
    // we need choose one callee from multiple callee
    LINPHONE_CODE_SIP_MULTIPLE_CHOICES = 300,
    // callee is moved permanently
    LINPHONE_CODE_SIP_MOVED_PERMANENTLY = 301,
    // callee is moved temporarily
    LINPHONE_CODE_SIP_MOVED_TEMPORARILY = 302,
    // we need use proxy to call callee
    LINPHONE_CODE_SIP_USE_PROXY = 305,
    LINPHONE_CODE_SIP_ALTERNATIVE_SERVICE = 380,
    LINPHONE_CODE_SIP_BAD_REQUEST = 400,
    // we need authenticate to call callee
    LINPHONE_CODE_SIP_UNAUTHORIZED = 401,
    // we need pay to call callee
    LINPHONE_CODE_SIP_PAYMENT_REQUIRED = 402,
    // we can't call callee
    LINPHONE_CODE_SIP_FORBIDDEN = 403,
    // callee is not found
    LINPHONE_CODE_SIP_NOT_FOUND = 404,
    // callee is not allowed to call
    LINPHONE_CODE_SIP_METHOD_NOT_ALLOWED = 405,
    // callee is not acceptable
    LINPHONE_CODE_SIP_NOT_ACCEPTABLE = 406,
    // we need authenticate to call callee in proxy
    LINPHONE_CODE_SIP_PROXY_AUTHENTICATION_REQUIRED = 407,
    LINPHONE_CODE_SIP_REQUEST_TIMEOUT = 408,
    LINPHONE_CODE_SIP_GONE = 410,
    LINPHONE_CODE_SIP_REQUEST_ENTITY_TOO_LARGE = 413,
    LINPHONE_CODE_SIP_REQUEST_URI_TOO_LONG = 414,
    LINPHONE_CODE_SIP_UNSUPPORTED_MEDIA_TYPE = 415,
    LINPHONE_CODE_SIP_UNSUPPORTED_URI_SCHEME = 416,
    LINPHONE_CODE_SIP_BAD_EXTENSION = 420,
    LINPHONE_CODE_SIP_EXTENSION_REQUIRED = 421,
    LINPHONE_CODE_SIP_INTERVAL_TOO_BRIEF = 423,
    LINPHONE_CODE_SIP_TEMPORARILY_UNAVAILABLE = 480,
    LINPHONE_CODE_SIP_CALL_TRANSACTION_DOES_NOT_EXIST = 481,
    LINPHONE_CODE_SIP_LOOP_DETECTED = 482,
    LINPHONE_CODE_SIP_TOO_MANY_HOPS = 483,
    LINPHONE_CODE_SIP_ADDRESS_INCOMPLETE = 484,
    LINPHONE_CODE_SIP_AMBIGUOUS = 485,
    LINPHONE_CODE_SIP_BUSY_HERE = 486,
    LINPHONE_CODE_SIP_REQUEST_TERMINATED = 487,
    LINPHONE_CODE_SIP_NOT_ACCEPTABLE_HERE = 488,
    LINPHONE_CODE_SIP_BAD_EVENT = 489,
    LINPHONE_CODE_SIP_REQUEST_PENDING = 491,
    LINPHONE_CODE_SIP_UNDECIPHERABLE = 493,
    LINPHONE_CODE_SIP_INTERNAL_SERVER_ERROR = 500,
    LINPHONE_CODE_SIP_NOT_IMPLEMENTED = 501,
    LINPHONE_CODE_SIP_BAD_GATEWAY = 502,
    LINPHONE_CODE_SIP_SERVICE_UNAVAILABLE = 503,
    LINPHONE_CODE_SIP_SERVER_TIMEOUT = 504,
    LINPHONE_CODE_SIP_VERSION_NOT_SUPPORTED = 505,
    LINPHONE_CODE_SIP_MESSAGE_TOO_LARGE = 513,
    LINPHONE_CODE_SIP_PRECONDITION_FAILURE = 580,
    LINPHONE_CODE_SIP_BUSY_EVERYWHERE = 600,
    LINPHONE_CODE_SIP_DECLINE = 603,
    LINPHONE_CODE_SIP_DOES_NOT_EXIST_ANYWHERE = 604,
    LINPHONE_CODE_SIP_NOT_ACCEPTABLE_ANYWHERE = 606,

    LINPHONE_CODE_OK = LINPHONE_CODE_SIP_OK,

    LINPHONE_CODE_CALL_INITIALIZED = 1,
    LINPHONE_CODE_CALL_INCOMING_RECEIVED = 10,
    LINPHONE_CODE_CALL_CONNECTED,
    LINPHONE_CODE_CALL_END,

    LINPHONE_CODE_CONFIG_SYNC = 20,
    LINPHONE_CODE_NEW_LOG,

    LINPHONE_CODE_ERR_UNKNOWN = 999,

} LINPHONE_CODE;

struct linphone_msg {
    int code;
};

extern char *linphone_code_to_string(LINPHONE_CODE code);

#endif // _LINPHONE_CODE_H_
